package com.baicaoyuan.web.repository;

import com.baicaoyuan.web.model.LotteryProjectItemDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface LotteryProjectItemRepository extends JpaRepository<LotteryProjectItemDO, Long> {
    @Transactional
    @Modifying
    @Query(value = "delete  from t_lottery_project_item  where lottery_project_id = ?1", nativeQuery = true)
    Integer deleteByLotteryProjectIdFk(Long lotteryProjectId);

    List<LotteryProjectItemDO> findByLotteryProjectId(Long lotteryProjectId);
}